'use strict';

const Service = require('egg').Service;
const utils = require('../utils/utils');
class ProductService extends Service {
// 首页菜单
  async list() {
    const res = await this.app.mysql.select('product');
    return res;
  }
  // 分类
  async classfyData() {
    const res = await this.app.mysql.select('classify');
    return utils.arrToTree([ ...res ]);
  }
}

module.exports = ProductService;
